package com.competentum.ui
{
	import flash.display.Sprite;
	
	import mx.controls.Alert;
	import mx.core.IFlexModuleFactory;

	/**
	 * Use this class if you want to control whether alert is shown or not at the moment
	 * 
	 * @author Valentine Abanosimov
	 * */
	public class AlertWithShowingFlag
	{
		public static var isShown:Boolean = false;
		
		public static function show(text:String = "", title:String = "",
									flags:uint = 0x4 /* Alert.OK */, 
									parent:Sprite = null, 
									closeHandler:Function = null, 
									iconClass:Class = null, 
									defaultButtonFlag:uint = 0x4 /* Alert.OK */,
									moduleFactory:IFlexModuleFactory = null):Alert
		{
			isShown = true;
			return Alert.show(text, title, flags, parent, closeHandler, iconClass, defaultButtonFlag, moduleFactory);
		}
	}
}